# -*- coding: utf-8 -*-
# standard
import os
import sys
from enum import Enum

# third

# local
_P_PATH =  os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
if _P_PATH not in sys.path:
    sys.path.append(_P_PATH)


"""
@Title:   
@File: base_models.py
@Author: walle 2023年10日16日 15时30分27秒
@Version: 1.0.0
@Desc: 
"""


class DateTimeFormat(Enum):
    """
    时间格式
    :param Enum: _description_
    """
    YMD = '%Y-%m-%d'
    YMDHMS = '%Y-%m-%d %H:%M:%S'
    YMDHMSF = '%Y-%m-%d %H:%M:%S.%f'
    YMDHM = '%Y-%m-%d %H:%M'
    YMDH = '%Y-%m-%d %H'
    YMDHMS_CN = '%Y年%m月%d日 %H:%M:%S'
    YMDHM_CN = '%Y年%m月%d日 %H:%M'


class VideoSourceSite(Enum):
    """
    视频的来源站点
    """
    YOUTUBE: str = "youtube"  
    BILIBILI: str = "bilibili"   

class VideoDownloadMethod(Enum):
    """
    视频的的下载方法
    """
    COMMAND_LINE: str = "command_line"  # 命令行调用第三方工具的方式获取视频
    API: str = "api"  # 调用API的方式获取视频


class ScpStatus(Enum):
    """
    scp状态
    """
    WAIT: str = "wait"  # 等待拷贝
    COPYING: str = "copying"  # 拷贝中
    SUCCESS: str = "success"  # 拷贝成功
    ERROR: str = "error"  # 拷贝失败


class VideoStatus(Enum):
    """
    视频状态
    """
    NORMAL: str = "normal"
    DOWNLOADING: str = "downloading"


class ContentType(Enum):
    """
    视频文件的 content-type
    """
    WMV: str = "video/x-ms-wmv"
    MP4: str = "video/mpeg4"
    AVI: str = "video/avi"
    WMA: str = "video/wma"
    WOV: str = "video/quicktime"
    THREE_GP: str = "video/3gpp"
    MP3: str = "audio/mp3"
    WEBM: str = "video/webm"      
    FLV: str = "video/x-flv"
    MPEG: str = "video/mpg"
    MTS: str = "video/vnd.dlna.mpeg-tts"
    VOB: str = "video/vob"
    MKV: str = "video/x-matroska"


class DownloadResponseError(Enum):
    """
    下载返回的错误
    :param Enum: _description_
    """
    FORBIDDEN: str = "禁止访问，可能是视频源私有，如果这种情况持续发生，那就是当前IP被列入黑名单了"
    BAN: str = "下载过程被ban, 建议等待一段时间重试"
    PARSE_ERROR: str = "API解析下载地址失败，可能视频源不存在或者权限限制"
    NOT_FOUND: str = "下载链接404, 旧的真实下载地址已失效，请重新使用api解析"
    NOT_FOUND_SECOND: str = "第二次下载链接404, 可能是api解析问题，暂时放弃"
    BAD_RESOURCE: str = "解析出来的下载地址出现requests.exceptions.ChunkedEncodingError错误, 原因不明,将来集中处理"


if __name__ == '__main__':
    pass